package com.zzr.zzrbackend.mapper;

import com.zzr.zzrbackend.pojo.domain.Relation;

import java.util.List;

public interface RelationMapper {
    List<Integer> selectChildIdByParentId(Integer parentId);

    int insert(Integer parentId, String invitationCode);

    Relation selectByCode(String code);

    Integer updateChildId(Integer childId, String code, Integer parentId);

    Integer updateCode(Integer parentId, String code);

    Integer selectParentIdByChildId(Integer childId);

    Relation selectByChildIdAndParentId(Integer childId, Integer parentId);

    Relation selectByChild(Integer childId);

    List<Relation> selectByParentId(Integer parentId);

    List<Relation> select(Integer parentId);

    Integer updateNullCode(Integer userId, String code);

    Integer deleteId(Integer childId, Integer parentId);
}
